package com.itrustsolution.rms.entities;
// Generated 25 Mei 11 22:19:57 by Hibernate Tools 3.2.1.GA


import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * RmsUser generated by hbm2java
 */
@Entity
@Table(name="rms_user"
    ,catalog="rms"
)
public class RmsUser  implements java.io.Serializable {


     private Integer userId;
     private RmsClient rmsClient;
     private RmsClientDept rmsClientDept;
     private String userCode;
     private String userUsername;
     private String userPassword;
     private String userFirstname;
     private String userLastname;
     private String userPhone;
     private String userPhoneExt;
     private String userMobile;
     private String userMail;
     private boolean userIsactive;
     private boolean userIsclient;
     private boolean userIsdeleted;
     private Date userCreateDate;
     private int userCreateBy;
     private Date userLastLogin;
     private Set<TckTicketLog> tckTicketLogs = new HashSet(0);
     private Set<RmsProduct> rmsGroups = new HashSet(0);

    public RmsUser() {
    }

	
    public RmsUser(String userCode, String userUsername, String userPassword, String userFirstname, String userMobile, String userMail, boolean userIsactive, boolean userIsclient, boolean userIsdeleted, Date userCreateDate, int userCreateBy, Date userLastLogin) {
        this.userCode = userCode;
        this.userUsername = userUsername;
        this.userPassword = userPassword;
        this.userFirstname = userFirstname;
        this.userMobile = userMobile;
        this.userMail = userMail;
        this.userIsactive = userIsactive;
        this.userIsclient = userIsclient;
        this.userIsdeleted = userIsdeleted;
        this.userCreateDate = userCreateDate;
        this.userCreateBy = userCreateBy;
        this.userLastLogin = userLastLogin;
    }
    public RmsUser(RmsClient rmsClient, RmsClientDept rmsClientDept, String userCode, String userUsername, String userPassword, String userFirstname, String userLastname, String userPhone, String userPhoneExt, String userMobile, String userMail, boolean userIsactive, boolean userIsclient, boolean userIsdeleted, Date userCreateDate, int userCreateBy, Date userLastLogin, Set tckTicketLogs, Set rmsGroups) {
       this.rmsClient = rmsClient;
       this.rmsClientDept = rmsClientDept;
       this.userCode = userCode;
       this.userUsername = userUsername;
       this.userPassword = userPassword;
       this.userFirstname = userFirstname;
       this.userLastname = userLastname;
       this.userPhone = userPhone;
       this.userPhoneExt = userPhoneExt;
       this.userMobile = userMobile;
       this.userMail = userMail;
       this.userIsactive = userIsactive;
       this.userIsclient = userIsclient;
       this.userIsdeleted = userIsdeleted;
       this.userCreateDate = userCreateDate;
       this.userCreateBy = userCreateBy;
       this.userLastLogin = userLastLogin;
       this.tckTicketLogs = tckTicketLogs;
       this.rmsGroups = rmsGroups;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="USER_ID", unique=true, nullable=false)
    public Integer getUserId() {
        return this.userId;
    }
    
    public void setUserId(Integer userId) {
        this.userId = userId;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="CLIENT_ID")
    public RmsClient getRmsClient() {
        return this.rmsClient;
    }
    
    public void setRmsClient(RmsClient rmsClient) {
        this.rmsClient = rmsClient;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="CLIENT_DEPT_ID")
    public RmsClientDept getRmsClientDept() {
        return this.rmsClientDept;
    }
    
    public void setRmsClientDept(RmsClientDept rmsClientDept) {
        this.rmsClientDept = rmsClientDept;
    }
    
    @Column(name="USER_CODE", nullable=false, length=10)
    public String getUserCode() {
        return this.userCode;
    }
    
    public void setUserCode(String userCode) {
        this.userCode = userCode;
    }
    
    @Column(name="USER_USERNAME", nullable=false, length=10)
    public String getUserUsername() {
        return this.userUsername;
    }
    
    public void setUserUsername(String userUsername) {
        this.userUsername = userUsername;
    }
    
    @Column(name="USER_PASSWORD", nullable=false, length=10)
    public String getUserPassword() {
        return this.userPassword;
    }
    
    public void setUserPassword(String userPassword) {
        this.userPassword = userPassword;
    }
    
    @Column(name="USER_FIRSTNAME", nullable=false, length=50)
    public String getUserFirstname() {
        return this.userFirstname;
    }
    
    public void setUserFirstname(String userFirstname) {
        this.userFirstname = userFirstname;
    }
    
    @Column(name="USER_LASTNAME", length=50)
    public String getUserLastname() {
        return this.userLastname;
    }
    
    public void setUserLastname(String userLastname) {
        this.userLastname = userLastname;
    }
    
    @Column(name="USER_PHONE", length=20)
    public String getUserPhone() {
        return this.userPhone;
    }
    
    public void setUserPhone(String userPhone) {
        this.userPhone = userPhone;
    }
    
    @Column(name="USER_PHONE_EXT", length=10)
    public String getUserPhoneExt() {
        return this.userPhoneExt;
    }
    
    public void setUserPhoneExt(String userPhoneExt) {
        this.userPhoneExt = userPhoneExt;
    }
    
    @Column(name="USER_MOBILE", nullable=false, length=20)
    public String getUserMobile() {
        return this.userMobile;
    }
    
    public void setUserMobile(String userMobile) {
        this.userMobile = userMobile;
    }
    
    @Column(name="USER_MAIL", nullable=false, length=50)
    public String getUserMail() {
        return this.userMail;
    }
    
    public void setUserMail(String userMail) {
        this.userMail = userMail;
    }
    
    @Column(name="USER_ISACTIVE", nullable=false)
    public boolean isUserIsactive() {
        return this.userIsactive;
    }
    
    public void setUserIsactive(boolean userIsactive) {
        this.userIsactive = userIsactive;
    }
    
    @Column(name="USER_ISCLIENT", nullable=false)
    public boolean isUserIsclient() {
        return this.userIsclient;
    }
    
    public void setUserIsclient(boolean userIsclient) {
        this.userIsclient = userIsclient;
    }
    
    @Column(name="USER_ISDELETED", nullable=false)
    public boolean isUserIsdeleted() {
        return this.userIsdeleted;
    }
    
    public void setUserIsdeleted(boolean userIsdeleted) {
        this.userIsdeleted = userIsdeleted;
    }
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="USER_CREATE_DATE", nullable=false, length=19)
    public Date getUserCreateDate() {
        return this.userCreateDate;
    }
    
    public void setUserCreateDate(Date userCreateDate) {
        this.userCreateDate = userCreateDate;
    }
    
    @Column(name="USER_CREATE_BY", nullable=false)
    public int getUserCreateBy() {
        return this.userCreateBy;
    }
    
    public void setUserCreateBy(int userCreateBy) {
        this.userCreateBy = userCreateBy;
    }
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="USER_LAST_LOGIN", nullable=false, length=19)
    public Date getUserLastLogin() {
        return this.userLastLogin;
    }
    
    public void setUserLastLogin(Date userLastLogin) {
        this.userLastLogin = userLastLogin;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="rmsUser")
    public Set<TckTicketLog> getTckTicketLogs() {
        return this.tckTicketLogs;
    }
    
    public void setTckTicketLogs(Set<TckTicketLog> tckTicketLogs) {
        this.tckTicketLogs = tckTicketLogs;
    }
@ManyToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY)
    @JoinTable(name="rms_user_group", catalog="rms", joinColumns = { 
        @JoinColumn(name="USER_ID", nullable=false, updatable=false) }, inverseJoinColumns = { 
        @JoinColumn(name="GROUP_ID", nullable=false, updatable=false) })
    public Set<RmsProduct> getRmsGroups() {
        return this.rmsGroups;
    }
    
    public void setRmsGroups(Set<RmsProduct> rmsGroups) {
        this.rmsGroups = rmsGroups;
    }




}


